<table cellpadding="0" cellspacing="0">
    <tr class="titleTable">

        <th><?php echo $this->Paginator->sort('Empresa'); ?></th>
        <th><?php echo $this->Paginator->sort('transporte'); ?></th>
        <th><?php echo $this->Paginator->sort('Chofer'); ?></th>
        <th><?php echo $this->Paginator->sort('Camion'); ?></th>
        <th><?php echo $this->Paginator->sort('Acoplado'); ?></th>
        <th><?php echo $this->Paginator->sort('Origen'); ?></th>
        <th><?php echo $this->Paginator->sort('Destino'); ?></th>
        <th><?php echo $this->Paginator->sort('Carga'); ?></th>
        <th><?php echo $this->Paginator->sort('Fecha'); ?></th>
        <th><?php echo $this->Paginator->sort('Total'); ?></th>
        <th class="actions"><?php echo __('Opciones'); ?></th>
    </tr>
    <?php foreach ($orders as $order): ?>
        <tr>
            <td><?php echo h($order['ClientCompany']['social_razon']); ?>&nbsp;</td>
            <td><?php echo h($order['Company']['social_razon']); ?>&nbsp;</td>
            <td><?php echo h($order['Driver']['name']); ?>&nbsp;</td>
            <td><?php echo h($order['Vehicle']['model']) . ' - ' . h($order['Vehicle']['domain']); ?>&nbsp;</td>
            <td><?php echo h($order['Coupled']['model']) . ' - ' . h($order['Coupled']['domain']); ?>&nbsp;</td>
            <td><?php echo h($order['Order']['origin']); ?>&nbsp;</td>
            <td><?php echo h($order['Order']['destination']); ?>&nbsp;</td>
            <td><?php echo h($order['Product']['name']); ?>&nbsp;</td>
            <td><?php echo $this->Time->format('d/m/Y', $order['Order']['date']); ?> &nbsp;</td>




            <?php if ($order['Order']['total'] >= 0) : ?>
                <td>
                <?php else : ?>
                <td class="negative_saldo">
                <?php endif; ?>

                <b> <?php echo h($order['Order']['total']); ?> </b>  &nbsp;

            </td> 

            <td class="actions">
                <?php echo $this->Html->link(__('Detalle'), array('action' => 'view', $order['Order']['id']), array('target' => '_blank')); ?>
                <?php echo $this->Form->postLink(__('Borrar'), array('action' => 'delete', $order['Order']['id'], $order['Order']['total']), null, __('¿Realmente desea borrar la orden de ruta perteneciente a "%s"?', $order['Company']['name'])); ?>

                <?php if ($this->Session->read('Auth.User.role') == 'admin'): ?>
                    <?php // echo $this->Html->link(__('Editar'), array('action' => 'edit', $order['Order']['id'])); ?>
                <?php endif; ?>
            </td>
        </tr>
    <?php endforeach; ?>
</table>
<p class="paginator_footer">
    <?php
    echo $this->Paginator->counter(array(
        'format' => __('Pagina {:page} de {:pages}, viendo {:current} resultados de un total de {:count}')
    ));
    ?>	</p>
<div class="paging">
    <?php
    echo $this->Paginator->prev('< ' . __('anterior'), array(), null, array('class' => 'prev disabled'));
    echo $this->Paginator->numbers(array('separator' => ''));
    echo $this->Paginator->next(__('siguiente') . ' >', array(), null, array('class' => 'next disabled'));
    ?>
</div>